package com.hsc.yalebao.weight;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Editable;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.model.ChatMsgEntity;
import com.hsc.yalebao.tools.UiUtil;

@SuppressLint({"NewApi"})
public class MyDialogForbidBibi extends Dialog
  implements View.OnClickListener
{
  private String TAG = "-MyDialogForbidBibi-";
  private Button btn_cancle;
  public Button btn_confirm;
  private Button btn_fengjin;
  private Context context;
  private EditText edit_forbid_reason;
  private String forbidBibiReason = "";
  private int forbidBibiType = 0;
  private float heightProportion = 1.0F;
  private RoundImageView img_photo;
  private LinearLayout layout_body;
  private ChatMsgEntity model;
  private MyDialogListener onClicklistener = null;
  private TextView text_nick_name;
  private TextView text_user_name;
  private TextView tv_0;
  private TextView tv_1;
  private TextView tv_2;
  private TextView tv_3;
  private float widthProportion = 0.98F;

  public MyDialogForbidBibi(Context paramContext)
  {
    super(paramContext);
    this.context = paramContext;
    initDialog();
  }

  public MyDialogForbidBibi(Context paramContext, int paramInt)
  {
    super(paramContext, paramInt);
    this.context = paramContext;
    initDialog();
  }

  public String getForbidBibiReason()
  {
    if (this.edit_forbid_reason != null)
      this.forbidBibiReason = this.edit_forbid_reason.getText().toString();
    return this.forbidBibiReason;
  }

  public int getForbidBibiType()
  {
    return this.forbidBibiType;
  }

  protected void initDialog()
  {
    setOnDismissListener(new DialogInterface.OnDismissListener()
    {
      public void onDismiss(DialogInterface paramAnonymousDialogInterface)
      {
        MyDialogForbidBibi.this.edit_forbid_reason.setText("");
      }
    });
    requestWindowFeature(1);
    getWindow().setContentView(2130903118);
    setCanceledOnTouchOutside(false);
    getWindow().getDecorView().getBackground().setAlpha(0);
    this.layout_body = ((LinearLayout)findViewById(2131100063));
    this.text_nick_name = ((TextView)findViewById(2131100070));
    this.text_user_name = ((TextView)findViewById(2131100071));
    this.img_photo = ((RoundImageView)findViewById(2131100043));
    this.tv_0 = ((TextView)findViewById(2131100072));
    this.tv_1 = ((TextView)findViewById(2131100073));
    this.tv_2 = ((TextView)findViewById(2131100074));
    this.tv_3 = ((TextView)findViewById(2131100075));
    this.tv_0.setOnClickListener(this);
    this.tv_1.setOnClickListener(this);
    this.tv_2.setOnClickListener(this);
    this.tv_3.setOnClickListener(this);
    this.tv_0.setBackgroundResource(2130837528);
    this.tv_1.setBackgroundResource(2130837524);
    this.tv_2.setBackgroundResource(2130837524);
    this.tv_3.setBackgroundResource(2130837524);
    this.edit_forbid_reason = ((EditText)findViewById(2131100076));
    this.btn_confirm = ((Button)findViewById(2131100064));
    this.btn_cancle = ((Button)findViewById(2131100066));
    this.btn_fengjin = ((Button)findViewById(2131100067));
    this.btn_confirm.setOnClickListener(this);
    this.btn_cancle.setOnClickListener(this);
    this.btn_fengjin.setOnClickListener(this);
    setDialogSize(this.widthProportion, this.heightProportion, 17);
  }

  @SuppressLint({"NewApi"})
  public void onClick(View paramView)
  {
    switch (paramView.getId())
    {
    case 2131100065:
    case 2131100068:
    case 2131100069:
    case 2131100070:
    case 2131100071:
    default:
    case 2131100064:
    case 2131100066:
    case 2131100067:
      do
      {
        do
          return;
        while (this.onClicklistener == null);
        this.onClicklistener.onClick(this.btn_confirm);
        return;
        if (this.onClicklistener != null)
          this.onClicklistener.onClick(this.btn_cancle);
        dismiss();
        return;
      }
      while (this.onClicklistener == null);
      this.onClicklistener.onClick(this.btn_fengjin);
      return;
    case 2131100072:
      this.forbidBibiType = 0;
      this.tv_0.setBackgroundResource(2130837528);
      this.tv_1.setBackgroundResource(2130837524);
      this.tv_2.setBackgroundResource(2130837524);
      this.tv_3.setBackgroundResource(2130837524);
      return;
    case 2131100073:
      this.forbidBibiType = 1;
      this.tv_0.setBackgroundResource(2130837524);
      this.tv_1.setBackgroundResource(2130837528);
      this.tv_2.setBackgroundResource(2130837524);
      this.tv_3.setBackgroundResource(2130837524);
      return;
    case 2131100074:
      this.forbidBibiType = 2;
      this.tv_0.setBackgroundResource(2130837524);
      this.tv_1.setBackgroundResource(2130837524);
      this.tv_2.setBackgroundResource(2130837528);
      this.tv_3.setBackgroundResource(2130837524);
      return;
    case 2131100075:
    }
    this.forbidBibiType = 3;
    this.tv_0.setBackgroundResource(2130837524);
    this.tv_1.setBackgroundResource(2130837524);
    this.tv_2.setBackgroundResource(2130837524);
    this.tv_3.setBackgroundResource(2130837528);
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
  }

  public void setDialogSize(float paramFloat1, float paramFloat2, int paramInt)
  {
    int i = CustomApplication.app.displayMetrics.widthPixels;
    Window localWindow = getWindow();
    WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
    localLayoutParams.width = ((int)(paramFloat1 * i));
    localWindow.setAttributes(localLayoutParams);
  }

  public void setForbidBibiReason(String paramString)
  {
    this.forbidBibiReason = paramString;
  }

  public void setForbidBibiType(int paramInt)
  {
    this.forbidBibiType = paramInt;
  }

  public void setOnButtonGroupClick(MyDialogListener paramMyDialogListener)
  {
    this.onClicklistener = paramMyDialogListener;
  }

  public void setOnDismissListener(DialogInterface.OnDismissListener paramOnDismissListener)
  {
    super.setOnDismissListener(paramOnDismissListener);
  }

  public void setUserData(ChatMsgEntity paramChatMsgEntity)
  {
    this.model = paramChatMsgEntity;
    String str1;
    if (paramChatMsgEntity != null)
    {
      str1 = paramChatMsgEntity.getPicurl();
      this.text_nick_name = ((TextView)findViewById(2131100070));
      this.text_user_name = ((TextView)findViewById(2131100071));
      this.img_photo = ((RoundImageView)findViewById(2131100043));
      if (UiUtil.isEmpty(str1))
        break label196;
      UiUtil.loadAndSetPhoto(this.img_photo, str1);
    }
    while (true)
    {
      String str2 = paramChatMsgEntity.getNickname();
      String str3 = paramChatMsgEntity.getUser_name();
      this.text_nick_name.setText(str2);
      this.text_user_name.setText(str3);
      LogUtils.i(this.TAG, "picUrl:" + str1);
      LogUtils.i(this.TAG, "nickName:" + str2);
      LogUtils.i(this.TAG, "userName:" + str3);
      return;
      label196: LogUtils.e(this.TAG, "picUrl为空");
      this.img_photo.setImageResource(2130838020);
    }
  }

  public static abstract interface MyDialogListener
  {
    public abstract void onClick(View paramView);
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.weight.MyDialogForbidBibi
 * JD-Core Version:    0.6.2
 */